package com.insigma.yanwenlong.bookkeeping.service;

import java.sql.SQLException;
import java.util.List;

import com.insigma.yanwenlong.bookkeeping.dao.AccountDao;
import com.insigma.yanwenlong.bookkeeping.dao.AccountDaoImpl;
import com.insigma.yanwenlong.bookkeeping.pojo.Account;


public class AccountServiceImpl implements AccountService {
	private AccountDao accountDao = new AccountDaoImpl();
	@Override
	public List<Account> findaAccounts() throws SQLException {
		return accountDao.findaAccounts();
	}
	@Override
	public int addAccount(Account account) throws SQLException {
		return accountDao.addAccount(account);
	}
	@Override
	public Account findAccountById(int id) throws SQLException {
		return accountDao.findAccountById(id);
	}
	@Override
	public int updateAccount(Account account) throws SQLException {
		return accountDao.updateAccount(account);
	}
	@Override
	public int deleteAccountById(int id) throws SQLException {
		return accountDao.deleteAccountById(id);
	}
	@Override
	public boolean deleteAccountBymemberId(int memberId) throws SQLException {
		return accountDao.deleteAccountBymemberId(memberId);
	}

}
